home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / MPW_TOOL / TOOLS / TOOLS_WI / PERL / OS2 / PERLSH.CMD < prev    next >
OS/2 REXX Batch file  |  1992-01-04  |  418b  |  20 lines

  1. extproc perl -x
  2. #!perl
  3.  
  4. # Poor man's perl shell.
  5.  
  6. # Simply type two carriage returns every time you want to evaluate.
  7. # Note that it must be a complete perl statement--don't type double
  8. #  carriage return in the middle of a loop.
  9.  
  10. print "Perl shell\n> ";
  11.  
  12. $/ = '';    # set paragraph mode
  13. $SHlinesep = "\n";
  14.  
  15. while ($SHcmd = <>) {
  16.     $/ = $SHlinesep;
  17.     eval $SHcmd; print $@ || "\n> ";
  18.     $SHlinesep = $/; $/ = '';
  19. }
  20.